package io.afu.sshhelper.client;

import io.afu.sshhelper.exceptions.SshHelperException;
import io.afu.sshhelper.rsa.RsaKeyPair;

/**
 * @author RffanLAB.方露宇
 * @version 0.1
 */
public class SshHelper {

    /**
     * 用户名
     */
    private String name;

    /**
     * 主机
     */
    private String host;

    /**
     * 端口
     */
    private Integer port;

    /**
     * 密码
     */
    private String password;

    /**
     * 私钥
     */
    private String privateKey;








    public SshHelper createInstance() {
        return new SshHelper();
    }

    /**
     * 远程SSH 执行命令。
     * @param cmds
     * @return
     */
    public String runCmd(String[] cmds) {
        String result = "";





        return result;
    }

    /**
     * 将本地的文件上传到远程服务器。
     * @param localFile
     * @param remoteFilePath
     * @throws SshHelperException
     */
    public void transferTo(String localFile,String remoteFilePath) throws SshHelperException {


    }

    /**
     * 从远程下载文件到本地
     * @param remoteFilePath
     * @param localFilePath
     * @throws SshHelperException
     */
    public void transferFrom(String remoteFilePath,String localFilePath) throws SshHelperException {


    }

    /**
     * 生成RSA 公钥和秘钥对
     * @return
     */
    public RsaKeyPair genKeyPair() {
        RsaKeyPair rsaKeyPair = new RsaKeyPair();


        return rsaKeyPair;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }
}
